home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C09 / Access.cpp next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  373 b   |  20 lines

  1. //: C09:Access.cpp
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Inline access functions
  7.  
  8. class Access {
  9.   int i;
  10. public:
  11.   int read() const { return i; }
  12.   void set(int ii) { i = ii; }
  13. };
  14.  
  15. int main() {
  16.   Access A;
  17.   A.set(100);
  18.   int x = A.read();
  19. } ///:~
  20.